<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>PlPN::Options - The options manager object</title>
<link rel="stylesheet" href="../PlPN.css" type="text/css" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:" />
</head>

<body>


<!-- INDEX BEGIN -->
<div name="index">
<p><a name="__index__"></a></p>

<ul>

	<li><a href="#name">NAME</a></li>
	<li><a href="#synopsis">SYNOPSIS</a></li>
	<li><a href="#description">DESCRIPTION</a></li>
	<li><a href="#methods">METHODS</a></li>
	<li><a href="#copyright_and_licence">COPYRIGHT and LICENCE</a></li>
</ul>

<hr name="index" />
</div>
<!-- INDEX END -->

<p>
</p>
<h1><a name="name">NAME</a></h1>
<p>PlPN::Options - The options manager object</p>
<p>
</p>
<hr />
<h1><a name="synopsis">SYNOPSIS</a></h1>
<pre>
        use PlPN qw(PN TRUE FALSE :OptionsGroup :ECachedOption :PNPath);
        
        my $om = PN-&gt;GetOptionsManager;
        my $value = $om-&gt;Get($group, $name, $default);
        my $pn_path = $om-&gt;GetPNPath;
        
        # etc.</pre>
<p>
</p>
<hr />
<h1><a name="description">DESCRIPTION</a></h1>
<p>Allows access and editing of Programmer's Notepad settings from Perl.</p>
<p>
</p>
<hr />
<h1><a name="methods">METHODS</a></h1>
<dl>
<dt><strong><a name="set" class="item">Set($group, $name, $value)</a></strong></dt>

<dt><strong><a name="get" class="item">Get($group, $name, $default)</a></strong></dt>

<dd>
<p>Sets or gets a setting. <code>$group</code> is optional during a group operation. (See
<a href="#begingroupoperation">BeginGroupOperation</a>.)</p>
<p>A group can be any text string. Programmer's Notepad defines several
built-in groups, which are exposed via the <code>:OptionsGroup</code> tag in
<a href="../PlPN.html">PlPN</a>. These constants are:</p>
<dl>
<dt><strong><a name="pnsk_mru" class="item">PNSK_MRU</a></strong></dt>

<dt><strong><a name="pnsk_mrup" class="item">PNSK_MRUP</a></strong></dt>

<dt><strong><a name="pnsk_interface" class="item">PNSK_INTERFACE</a></strong></dt>

<dt><strong><a name="pnsk_editor" class="item">PNSK_EDITOR</a></strong></dt>

<dt><strong><a name="pnsk_print" class="item">PNSK_PRINT</a></strong></dt>

<dt><strong><a name="pnsk_defgui" class="item">PNSK_DEFGUI</a></strong></dt>

<dt><strong><a name="pnsk_find" class="item">PNSK_FIND</a></strong></dt>

<dt><strong><a name="pnsk_schemes" class="item">PNSK_SCHEMES</a></strong></dt>

<dt><strong><a name="pnsk_general" class="item">PNSK_GENERAL</a></strong></dt>

</dl>
<p><code>$default</code> is <strong>not</strong> optional. The reason for this is that this is a
wrapper for an overloaded C++ function, and the type of the value is
required in order for C++ to be able to determine which version of the
function to call.</p>
<p>If there is any doubt, you can make sure your strings are interpreted as
strings by quoting them, you can make sure your numbers are interpretd as
numbers by adding <code>0</code> to them, and you can make sure your Booleans are
interpreted as Booleans by using the constants <strong>TRUE</strong> and <strong>FALSE</strong> provided
via <a href="../PlPN.html">PlPN</a>:</p>
<pre>
        $om-&gt;Set($group, $name, &quot;$value&quot;);
        $om-&gt;Get($group, $name, &quot;$default&quot;);
        $om-&gt;Set($group, $name, $value+0);
        $om-&gt;Get($group, $name, $default+0);
        $om-&gt;Set($group, $name, $value ? TRUE : FALSE);
        $om-&gt;Get($group, $name, $default ? TRUE : FALSE);</pre>
<p>The reason for this is because it was considered more important to have a
simple Perl interface, with two methods instead of six (i.e., a setter and
a getter for each of string, number, and Boolean). Perl will usually guess
right betwee strings and numbers, so the precautionary measures will usually
be unnecessary, except for Booleans.</p>
<p><strong>Important note about Boolean values</strong>: Do not assume you can substitute
<code>1</code> for Boolean true and <code>0</code> for Boolean false. While this will work if
the settings are stored in the Windows registry, it will not work if the
settings are stored in XML, which uses the strings <code>true</code> and <code>false</code> to
represent those values.</p>
<p>If you are going to use Boolean values, especially for settings used by
other parts of Programmer's Notepad, use <strong>TRUE</strong> and <strong>FALSE</strong>. This will
guarantee that the XS code properly interprets the value before calling the
C++ function.</p>
</dd>
<dt><strong><a name="getpnpath" class="item">GetPNPath($pathtype = PNPATH_PN)</a></strong></dt>

<dd>
<p>Retrieves the given path. Path type constants are available via the
<code>:PNPath</code> tag in <a href="../PlPN.html">PlPN</a>. These constants are:</p>
<dl>
<dt><strong><a name="pnpath_pn" class="item">PNPATH_PN</a></strong></dt>

<dt><strong><a name="pnpath_schemes" class="item">PNPATH_SCHEMES</a></strong></dt>

<dt><strong><a name="pnpath_clips" class="item">PNPATH_CLIPS</a></strong></dt>

<dt><strong><a name="pnpath_tools" class="item">PNPATH_TOOLS</a></strong></dt>

<dt><strong><a name="pnpath_taggers" class="item">PNPATH_TAGGERS</a></strong></dt>

<dt><strong><a name="pnpath_projecttemplates" class="item">PNPATH_PROJECTTEMPLATES</a></strong></dt>

<dt><strong><a name="pnpath_presets" class="item">PNPATH_PRESETS</a></strong></dt>

<dt><strong><a name="pnpath_usermin" class="item">PNPATH_USERMIN</a></strong></dt>

<dt><strong><a name="pnpath_usersettings" class="item">PNPATH_USERSETTINGS</a></strong></dt>

<dt><strong><a name="pnpath_usertools" class="item">PNPATH_USERTOOLS</a></strong></dt>

<dt><strong><a name="pnpath_compiledschemes" class="item">PNPATH_COMPILEDSCHEMES</a></strong></dt>

<dt><strong><a name="pnpath_userclips" class="item">PNPATH_USERCLIPS</a></strong></dt>

</dl>
</dd>
<dt><strong><a name="getcached" class="item">GetCached($option)</a></strong></dt>

<dt><strong><a name="setcached" class="item">SetCached($option, $value)</a></strong></dt>

<dd>
<p>Gets or sets one of the cached options. Cached options are read into memory
by Programmer's Notepad, so getting and setting them does not require
reading from or writing to disk. Cahced options constants are available via
the <code>:PNPath</code> tag in <a href="../PlPN.html">PlPN</a>. These constants are:</p>
<dl>
<dt><strong><a name="ousetabs" class="item">OUseTabs</a></strong></dt>

<dt><strong><a name="otabwidth" class="item">OTabWidth</a></strong></dt>

<dt><strong><a name="oshowindentguides" class="item">OShowIndentGuides</a></strong></dt>

<dt><strong><a name="olinenumbers" class="item">OLineNumbers</a></strong></dt>

<dt><strong><a name="omaximisenew" class="item">OMaximiseNew</a></strong></dt>

<dt><strong><a name="oshowfullpath" class="item">OShowFullPath</a></strong></dt>

<dt><strong><a name="olinehighlight" class="item">OLineHighlight</a></strong></dt>

<dt><strong><a name="owordwrap" class="item">OWordWrap</a></strong></dt>

<dt><strong><a name="orightguide" class="item">ORightGuide</a></strong></dt>

<dt><strong><a name="orightcolumn" class="item">ORightColumn</a></strong></dt>

<dt><strong><a name="olinehighlightcolour" class="item">OLineHighlightColour</a></strong></dt>

<dt><strong><a name="orightguidecolour" class="item">ORightGuideColour</a></strong></dt>

<dt><strong><a name="olineendings" class="item">OLineEndings</a></strong></dt>

<dt><strong><a name="oalreadyopendropaction" class="item">OAlreadyOpenDropAction</a></strong></dt>

<dt><strong><a name="oalreadyopenaction" class="item">OAlreadyOpenAction</a></strong></dt>

<dt><strong><a name="odefaultcodepage" class="item">ODefaultCodePage</a></strong></dt>

<dt><strong><a name="odefaultscintillacache" class="item">ODefaultScintillaCache</a></strong></dt>

<dt><strong><a name="ofindalphaenabled" class="item">OFindAlphaEnabled</a></strong></dt>

<dt><strong><a name="ofindalphapercent" class="item">OFindAlphaPercent</a></strong></dt>

<dt><strong><a name="ovisiblelineendings" class="item">OVisibleLineEndings</a></strong></dt>

<dt><strong><a name="ovisiblewhitespace" class="item">OVisibleWhiteSpace</a></strong></dt>

<dt><strong><a name="omanagetaborder" class="item">OManageTabOrder</a></strong></dt>

<dt><strong><a name="oconvertlinesonpaste" class="item">OConvertLinesOnPaste</a></strong></dt>

<dt><strong><a name="odefaultcharset" class="item">ODefaultCharSet</a></strong></dt>

<dt><strong><a name="oautocomplete" class="item">OAutoComplete</a></strong></dt>

<dt><strong><a name="oautocompleteusekeywords" class="item">OAutoCompleteUseKeywords</a></strong></dt>

<dt><strong><a name="oautocompleteusetags" class="item">OAutoCompleteUseTags</a></strong></dt>

<dt><strong><a name="oautocompletestartchars" class="item">OAutoCompleteStartChars</a></strong></dt>

<dt><strong><a name="oautocompleteactivation" class="item">OAutoCompleteActivation</a></strong></dt>

<dt><strong><a name="oautocompletetags" class="item">OAutoCompleteTags</a></strong></dt>

<dt><strong><a name="olinehighlightalpha" class="item">OLineHighlightAlpha</a></strong></dt>

<dt><strong><a name="ofoldingenabled" class="item">OFoldingEnabled</a></strong></dt>

<dt><strong><a name="ocaretxmove" class="item">OCaretXMove</a></strong></dt>

<dt><strong><a name="ocaretymove" class="item">OCaretYMove</a></strong></dt>

<dt><strong><a name="ocaretxflags" class="item">OCaretXFlags</a></strong></dt>

<dt><strong><a name="ocaretyflags" class="item">OCaretYFlags</a></strong></dt>

<dt><strong><a name="osmarthighlight" class="item">OSmartHighlight</a></strong></dt>

<dt><strong><a name="olinepaddingtop" class="item">OLinePaddingTop</a></strong></dt>

<dt><strong><a name="olinepaddingbottom" class="item">OLinePaddingBottom</a></strong></dt>

<dt><strong><a name="odefaultencoding" class="item">ODefaultEncoding</a></strong></dt>

<dt><strong><a name="omultibytecodepage" class="item">OMultiByteCodePage</a></strong></dt>

</dl>
<p></p>
</dd>
<dt><strong><a name="begingroupoperation" class="item">BeginGroupOperation($group)</a></strong></dt>

<dt><strong><a name="endgroupoperation" class="item">EndGroupOperation()</a></strong></dt>

<dd>
<p>Begins or ends a group operation. Groups are described under <a href="#set">Set</a>.</p>
</dd>
<dt><strong><a name="getsearchoptions" class="item">GetSearchOptions()</a></strong></dt>

<dd>
<p>Gets the global search options, a <a href="./SearchOptions.html">PlPN::SearchOptions</a>
object.</p>
<p>See also <a href="./PN.html#getusersearchoptions">PlPN::PN::GetUserSearchOptions</a>.</p>
</dd>
</dl>
<p>
</p>
<hr />
<h1><a name="copyright_and_licence">COPYRIGHT and LICENCE</a></h1>
<p>Copyright (c) 2012 Sean Healy. All rights reserved.</p>
<p>This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.</p>

</body>

</html>
